Naïve, client-side sharding with online addition of shards

ABSTRACT

Multiple clients can be enabled to perform operations relative to data items in a shard system asynchronously to each other without the use by those clients of exclusive locks. A rebalancing event, in which data items are redistributed automatically among a set of shards due to a modification of the quantity of shards in the system, can be performed without the use of exclusive locks by clients. Clients can continue to perform operations relative to at least some of the data items in the shard system even while rebalancing processes are redistributing at least some of the data items asynchronously during a system-wide rebalancing event. All of these benefits can be obtained without sacrificing data consistency within the shard system.

CROSS-REFERENCES TO RELATED APPLICATIONS; PRIORITY CLAIM

The present application claims priority under 35 U.S.C. §119 to U.S.Provisional Patent Application Ser. No. 61/841,045, titled NAÏVE,CLIENT-SIDE SHARDING WITH ONLINE ADDITION OF SHARDS, filed on Jun. 28,2013, and the entire contents of which are incorporated by referenceherein.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

BACKGROUND

In a system of database shards, data items, such as records or rows ordocuments, can be distributed among multiple separate, independentdatabases, called shards. In such a system, data items typically arenot, and are not permitted to be, duplicated among the shards. Thus, insuch a system, a particular data item will be located on only one of theseveral shards at any given time. In order for a client to determinewhich of the several shards contains the particular data item, theclient can input the data item's primary key—which uniquely identifiesthe particular data item—into a hash function. The hash functioncomputes, based on the primary key, the identity of the shard on whichthe particular data item is currently stored. For example, a hashfunction might divide a numeric primary key by the quantity of shards inthe system and then take the remainder (essentially a modulo operation)to be the identifier for the shard that contains the particular dataitem. Using such a hash function to determine, in the first place, theshard on which each data item will be stored typically causes data itemsto be distributed relatively evenly among the shards.

Once the client has identified the shard upon which a particular dataitem is located, the client can perform operations, such as read,delete, or update operations, relative to the data item. Usually, ashard system will serve numerous clients concurrently, and these clientsmay each perform, asynchronously to each other, operations relative toseparate data items. Potentially, multiple clients could inadvertentlyattempt to perform operations relative to the same data itemsimultaneously. If this scenario were permitted to occur unhindered,then the data item could become corrupted, making the state of the shardsystem inconsistent. Under one approach, in order to guarantee thatmultiple clients will not concurrently perform operations relative tothe same data item, a client that seeks to perform an operation relativeto a particular data item can first be required to acquire an exclusivelock on that particular data item. Each data item can be associated witha separate lock. A client is prevented from acquiring the exclusive lockon the particular data item if another client already holds thatexclusive lock; under such circumstances, the client seeking to obtainthe exclusive lock must wait for the lock-holding client to release theexclusive lock. While a client is holding the exclusive lock on aparticular data item, that client alone can perform operations relativeto the particular data item. When the client has finished performingoperations relative to the particular data item, the client can releasethe exclusive lock on the particular data item, thereby making theparticular data item available for access by other clients.

As the quantity of data stored within the shard system grows, thecapacity of the existing shards in the system might become inadequate tocontain all of the data that is going to be stored in the system. It canbe desirable, under those circumstances, to add one or more new shardsto the system. The addition of new shards can involve the addition ofnew hardware computing and storage devices to contain and manage newdatabases. In order to attempt to balance the client access load amongthe shards, so that no one subset of shards becomes disproportionatelyburdened with client requests, the addition of new shards to the systemcan precipitate a redistribution of the system's stored data items amongthe augmented group of shards. The redistribution event, or rebalancingevent, can cause data items that were formerly stored on one shard to bere-located to another shard—potentially, but not necessarily, to a newlyadded shard. Under one approach, rebalancing processes can obtainexclusive locks on the data items that are to be moved. After obtainingthe exclusive locks on the data items, the rebalancing processes canmove those data items from old shards to the new shards that have beendetermined by a revised hash function to be the destination for thosedata items. After moving the data items, the rebalancing processes canrelease the exclusive locks on those data items.

For as long as exclusive locks have existed, some drawbacks haveattended their uses. One drawback is that while a data item's exclusivelock is held by a process, no other process can access that data item.Thus, under the lock-using rebalancing approach discussed above, clientsmay be largely unable to perform operations relative to the shard systemwhile the rebalancing event proceeds; no client can obtain an exclusivelock on a data item while a rebalancing process holds that exclusivelock. Even when the rebalancing event is not ongoing, the overheadinvolved in clients' acquisition, maintenance, and release of locks—toguard against concurrent multiple client access—can be significant andburdensome. Even ignoring the effects of rebalancing events, the use oflocks within a shard system can negatively impact system efficiency andperformance. Perhaps worse still, unexpected failures within the shardsystem can cause a lock-holding process (which could be, for example, aclient or a rebalancing process) to freeze up or otherwise quitfunctioning properly. Under such circumstances, the non-functionalprocess may retain an exclusive lock on a particular data item untilsome timer expires, at which time the non-functional process may beterminated, and the locks it held forcibly released. Other processes,including clients and rebalancing processes, are consequently forced towait for the timer's expiration before proceeding with their intendedtasks relative to that particular data item. Especially if theoperations to be performed relative to the particular data item are justone step within a strictly ordered sequence of operations to beperformed relative to multiple separate data items, such forced waitingcan cause the performance of the entire shard system to degradenoticeably. Dependencies imposed by orders in which operations oftenneed to be performed can cause these kinds of complications to cascade.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an example of a scalable shardsystem in which multiple clients can access data items that have beendistributed among multiple database shards, according to an embodimentof the invention;

FIG. 2 is a state diagram that illustrates the various states in whichsystem can exist at various moments in time, and the possibletransitions between those states, according to an embodiment of theinvention;

FIG. 3 is a flow diagram that illustrates an example of a technique forperforming an add operation while in the rebalancing state, according toan embodiment of the invention;

FIG. 4 is a flow diagram that illustrates an example of a technique forperforming an update operation while in the rebalancing state, accordingto an embodiment of the invention;

FIG. 5 is a flow diagram that illustrates an example of a technique forperforming a delete operation while in the rebalancing state, accordingto an embodiment of the invention;

FIGS. 6A-6B are flow diagrams that illustrate an example of a techniquefor performing a get operation while in the rebalancing state, accordingto an embodiment of the invention;

FIG. 7 is a flow diagram that illustrates an example of a technique forperforming a rebalancing operation while in the rebalancing state(initially), according to an embodiment of the invention;

FIG. 8 is a flow diagram that illustrates an example of a technique forperforming a query operation while in the rebalancing state, accordingto an embodiment of the invention;

FIG. 9 depicts a simplified diagram of a distributed system forimplementing one of the embodiments.

FIG. 10 is a simplified block diagram of components of a systemenvironment by which services provided by the components of anembodiment system may be offered as cloud services, in accordance withan embodiment of the present disclosure.

FIG. 11 illustrates an example of a computer system in which variousembodiments of the present invention may be implemented.

DETAILED DESCRIPTION

In the following description, for the purposes of explanation, specificdetails are set forth in order to provide a thorough understanding ofembodiments of the invention. However, it will be apparent that theinvention may be practiced without these specific details.

According to an embodiment of the invention, multiple clients can beenabled to perform operations relative to data items in a shard systemasynchronously to each other without the use by those clients ofexclusive locks. Furthermore, according to an embodiment of theinvention, a rebalancing event, in which data items are redistributedautomatically among a set of shards due to a modification (addition orimpending removal) of the quantity of shards in the system, can beperformed without the use of exclusive locks by clients. Additionally,in an embodiment of the invention, clients can continue to performoperations relative to at least some of the data items in the shardsystem even while rebalancing processes are redistributing at least someof the data items asynchronously during a system-wide rebalancing event.The programmatic code that provides these features can be locatedexclusively on the clients rather than the shard servers. All of thesebenefits can be obtained without sacrificing data consistency within theshard system.

Example Scalable Shard System

FIG. 1 is a block diagram illustrating an example of a scalable shardsystem 100 in which multiple clients can access data items that havebeen distributed among multiple database shards, according to anembodiment of the invention. Shard system 100 includes clients 102A-Nand shards 104A-N. The quantities of clients and shards in system 100can vary. Each of shards 104A-N can be a separate and independentdatabase that does not need to be aware of any other shard within system100. Each of shards 104A-N can include a separate database server andrelational database, for example. Although databases are discussedherein as a concrete example, embodiments of the invention can beapplied to a variety of kinds of data repositories (e.g., LightweightDirectory Access Protocol (LDAP) directories, flat files, associativememories, etc.) other than databases. Each of clients 102A-N can be aseparate computing system that can operate independently of each otherof clients 102A-N. For example, clients 102A-N can be desktop computers,laptop computers, mobile devices, etc.

Clients 102A-N can interact with shards 104A-N through a network 106.Network 106 can be, or can include, a local area network (LAN), a widearea network (WAN), and/or the Internet. Communication over network 106can be achieved through a suite of network communication protocols suchas Ethernet, Transmission Control Protocol/Internet Protocol (TCP/IP),Hypertext Transfer Protocol (HTTP), Simple Object Access Protocol(SOAP), Open Database Connectivity (ODBC), etc. Each of clients 102A-Ncan execute a separate instance of a software program that utilizes ahash function in order to calculate, based on the primary key of aparticular data item, the identity of a particular shard, among shards104A-N, on which that particular data item either has been stored or isto be stored. Such data items can be separate records possessingdifferent values for similar attribute sets. At least in one embodiment,such data items can be stored within shards 104A-N as separate rowswithin one or more relational database tables. With very specificexceptions discussed below that are applicable to system 100 duringrebalancing events, each data item is located on only one of shards104A-N at any particular moment in time. A rebalancing event canpotentially cause various data items to be relocated from one shard toanother shard. In an embodiment of the invention, the sequence ofactivities involved in a client's performance of an operation during arebalancing event can differ from the sequence of activities involved inthat client's performance of that same type of operation during “normal”system states occurring outside of a rebalancing event.

Generally, in order to perform an operation relative to a data item thatalready is stored on a particular one of shards 104A-N, a particularclient of clients 102A-N can first determine (e.g., based on the hashfunction) the shard on which that data item is currently stored. Duringa rebalancing event, the particular client can perform checks to ensurethat the particular client will be operating on the correct copy of thedata item, to compensate for the possibility that the data item mighthave been relocated or deleted asynchronously to the particular client'sactivities. Although during normal system states only one copy of a dataitem can exist anywhere in system 100, during a rebalancing event it ispossible for multiple copies—different versions—of a data item to bepresent temporarily within system 100. In performing these checks, theparticular client can make use of version information (discussed ingreater detail below) that is stored with each copy of each data item.Based at least in part on such version information, the particularclient can ensure that the operation, if performed, will be performedrelative to the copy of the data item stored on the shard on which thedata item was most recently placed. The particular client's performanceof the operation during a rebalancing event can involve the creation ofa new copy of the data item on a shard separate from the shard on whichanother copy of the data item previously existed. In an embodiment, theoperation can involve the execution of one or more instructions relativeto the data item. For example, such instructions can take the form ofquery language instructions—Structured Query Language (SQL) instructionsbeing just one specific possibility. After the particular client'sperformance of the operation relative to a newest copy of the data item,a cleanup operation can be performed to remove old and outdated versionsof the data item from shards on which the data item should no longerexist. Generally, data consistency within system 100 can be maintainedin this manner without the use of locks by clients 102A-N.

According to an embodiment of the invention, system 100 is scalablebecause shards can be added to (or removed from) system 100. Themodification of the quantity of shards 104A-N can cause a rebalancingevent to occur within system 100. During the rebalancing event,rebalancing processes can re-hash each data item's primary key based onthe new quantity of shards instead of the old quantity, therebydetermining the identity of the shard (different or the same) on whichthat data item should be located as of the conclusion of the rebalancingevent. The rebalancing processes can then relocate data items from shardto shard using techniques discussed in greater detail below. Therelocation can involve the creation and deletion of copies of the dataitems that would not exist within system 100 outside of the rebalancingevent. The rebalancing processes can execute asynchronously to softwareexecuting on clients 102A-N. Beneficially, clients 102A-N can continueto perform operations relative to data items during the rebalancingoperation, at least in part by adjusting the sequence of activities thatclients 102A-N perform during the rebalancing operation.

Versions and Tombstone Attributes

As is mentioned above, in an embodiment of the invention, each copy of aparticular data item can be stored in association with versioninformation. In an embodiment, such version information can take theform of a system-wide version number that is incremented each time thatrebalancing event occurs in system 100. Thus, for example, if anexisting data item's version number is 3, and if the system's currentversion number is 4 at the time a new copy of the data item is createdon a different shard during a rebalancing event, then the new copy ofthat data item will have version number 4. By examining the versioninformation of two separate copies of a data item, which may existduring a rebalancing event, a client can determine which copy is thenewer version, and can perform operations relative to that copy.Additionally, by examining the version information of two separatecopies of a data item, which may exist during a rebalancing event, arebalancing process can determine which copy is the older version, andtherefore ought to be removed from the shard on which that copy islocated.

Operations that a client performs can involve deleting a data item froma shard. In an embodiment, a client's performance of a deletionoperation relative to a data item does not instantly remove all tracesof that data item from the shard on which it was located. Instead, in anembodiment, each data item has an attribute called a “tombstone” whosevalue can be set to true (if that copy of the data item on that shardhas been deleted) or false (if that copy of the data item on that shardhas not been deleted). The setting of a data item's tombstone attributeto “true” avoids ambiguous situations that otherwise might occur when adata item's absence on a shard could be due either to deletion or tomovement to another shard as part of a rebalancing event. In anembodiment, only rebalancing processes (and not clients) are permittedto remove data items from shards completely.

System State Transitions

As is discussed above, at different moments of time, system 100 could bein a state in which it is performing a rebalancing event, or system 100could be in a state outside of such a rebalancing event. Also as isdiscussed above, the sequences of activities that clients 102A-N performas part of operations relative to data items during a rebalancing eventcan differ from the sequences of activities that clients 102A-N performas parts of operations of the same type during states in which anrebalancing event is not occurring. Viewed in a simplified manner,during the “normal” state that exists while system 100 is not undergoinga rebalancing event, clients 102A-N may perform operations relative todata items using simple, highly efficient “naïve” techniques that maylack safeguards that protect against certain kinds of inconsistencies.In contrast, during a state that exists while system 100 is undergoing arebalancing event, clients 102A-N may perform the same types ofoperations using more complex, more cautious techniques that impose suchsafeguards. Such safeguards, which might be unnecessary outside ofrebalancing events, can be suitable during rebalancing events.

FIG. 2 is a state diagram that illustrates the various states 200 inwhich clients 102A-N can exist at various moments in time, and thepossible transitions between those states, according to an embodiment ofthe invention. States 200 can include a normal state 202, an enterrebalance state 204, a rebalancing state 206, an enter cleanup state208, a cleanup state 210, and a leave rebalance state 212. In oneembodiment, clients 102A-N are permitted to perform operations relativeto data items stored within shards 104A-N only during normal state 202and rebalancing state 206, which are likely to be the states in whichclients 102A-N are during the vast majority of the time. Althoughclients 102A-N will usually be in the same state, separate ones of thoseclients can briefly be in different states during state transitions, aswill be seen from the discussion below.

According to an embodiment, clients 102A-N can initialize in normalstate 202. Clients 102A-N can begin new operations while in normal state202. A notification mechanism can inform each of clients 102A-N that oneor more shards have been added to or are going to be removed from system100. In response to such a notification, each of clients 102A-N can waitfor its pending operations to complete, and then that client cantransition to enter rebalance state 204. Clients 102A-N do not begin newoperations while in enter rebalance state 204; clients 102A-N can queueup operations to be performed. When all of clients 102A-N havetransitioned to enter rebalance state 204, each of clients 102A-N cantransition to rebalancing state 206. Once clients 102A-N have enteredrebalancing state 206, rebalancing processes can proceed to move dataitems from source shards to destination shards. In an embodiment of theinvention, the current version number, with which new data item copieswill become associated from that moment onward, can be incremented uponthe entry of clients 102A-N into rebalancing state 206. Clients 102A-Ncan begin new operations (potentially including queued up operations)while in rebalancing state 206. When the rebalancing processes havemoved all data items that are to be relocated, a notification mechanismcan inform each of clients 102A-N of this fact. In response to such anotification, each of clients 102A-N can wait for its pending operationsto complete, and then that client can transition to enter cleanup state208. Clients 102A-N do not begin new operations while in enter cleanupstate 208; clients 102A-N can queue up operations to be performed. Whenall of clients 102A-N have transitioned to enter cleanup state 208, eachof clients 102A-N can transition to cleanup state 210. Once clients102A-N have entered cleanup state 210, rebalancing processes can proceedto remove, from the shards, data item copies that should no longer existon any shard. In an embodiment, while clients 102A-N are in cleanupstate 210, rebalancing processes can remove, from the shards, all dataitem copies having a “true” tombstone attribute value. Additionally, inan embodiment, while clients 102A-N are in cleanup state 210,rebalancing processes can remove, from the shards, all data item copieshaving a version number attribute value that is less than the system'scurrent version number. Clients 102A-N do not begin new operations whilein cleanup state 210; clients 102A-N can queue up operations to beperformed. When the rebalancing processes have removed all data itemcopies that are to be removed, a notification mechanism can inform eachof clients 102A-N of this fact. In response to such a notification, eachof clients 102A-N can transition to leave rebalance state 212. Clients102A-N do not begin new operations while in leave rebalance state 212;clients 102A-N can queue up operations to be performed. When all ofclients 102A-N have transitioned to leave rebalance state 212, each ofclients 102A-N can transition back to normal state 202. Clients 102A-Ncan begin new operations (potentially including queued up operations)while in normal state 202.

As is discussed above, while clients 102A-N are in rebalancing state206, clients 102A-N can perform operations in a more cautious mannerthan then manner in which clients 102A-N would perform the same types ofoperations while in normal state 202. The manner in which clients 102A-Ncan perform operations while in rebalancing state 206 can guarantee dataconsistency in spite of the concurrent asynchronous execution ofrebalancing processes that may be relocating data items from shard toshard—a concern that does not exist in normal state 202. Discussed beloware techniques for performing various different types of operations inthis more cautious, consistency-guaranteeing manner while in rebalancingstate 206.

Add Operations

FIG. 3 is a flow diagram that illustrates an example of a technique 300for performing an add operation while in the rebalancing state,according to an embodiment of the invention. Although technique 300 isillustrated as including specific activities performed in a specificorder, alternative embodiments of the invention can involve techniqueshaving additional, fewer, or different activities. Any of clients 102A-Ncan perform technique 300. In block 302, a client can determine theidentity of the source shard on which a particular data item would havebeen located prior to the change in shard quantity. This determinationcan be achieved, for example, by calculating the particular data item'sprimary key modulo the old shard quantity. In block 304, the client candetermine the identity of the destination shard on which the particulardata item is to be located following the change in shard quantity. Thisdetermination can be achieved, for example, by calculating theparticular data item's primary key modulo the new shard quantity. Inblock 306, the client can determine whether the identity of the sourceshard is the same as the identity of the destination shard. If theidentities are the same, then control passes to block 308. Otherwise,control passes to block 310.

In block 308, the client can add the particular data item to thedestination shard in the normal, naïve, highly efficient standard mannerfor performing an add operation. At this point, technique 300terminates.

Alternatively, in block 310, the client can determine whether a dataitem having the particular data item's primary key already exists on thesource shard. If a data item having the particular data item's primarykey already exists on the source shard, then control passes to block312. Otherwise, control passes to block 314.

In block 312, the client can conclude that the particular data itemduplicates a data item already existing in the shard system, and canrefrain from performing the add operation. The client can signify to auser that the add operation was prevented due to duplication. At thispoint, technique 300 terminates.

Alternatively, in block 314, the client can determine whether therealready exists, on the destination shard, a data item having both (a)the particular data item's primary key and (b) a tombstone attributevalue of “true.” If there already exists, on the destination shard, adata item having both (a) the particular data item's primary key and (b)a tombstone attribute value of “true,” then control passes to block 316.Otherwise, control passes to block 320.

In block 316, as part of an atomic action, the client can assign, to theattribute values of the data item having the particular data item'sprimary key (on the destination shard), the attribute values of theparticular data item. This assignment essentially updates the data itemexisting on the destination shard. The client can assign the system'scurrent version number to the data item's version number attribute. Inblock 318, as part of the same atomic action, the client can set thetombstone attribute value of the data item having the particular dataitem's primary key (on the destination shard) to “false.” In anembodiment, the attribute value assignment of block 316 achieves thesame result as that achieved by the activity of block 318, since theparticular data item's tombstone attribute value will already be “false”prior to the assignment. The client can signify to a user that the addoperation succeeded. At this point, technique 300 terminates.

Alternatively, in block 320, the client can insert the particular dataitem into the destination shard. The client can assign the system'scurrent version number to the particular data item's version numberattribute. The client can signify to a user that the add operationsucceeded. At this point, technique 300 terminates. In an embodiment ofthe invention, the activities of blocks 314-320 are performed as asingle atomic operation.

Update Operations

FIG. 4 is a flow diagram that illustrates an example of a technique 400for performing an update operation while in the rebalancing state,according to an embodiment of the invention. Although technique 400 isillustrated as including specific activities performed in a specificorder, alternative embodiments of the invention can involve techniqueshaving additional, fewer, or different activities. Any of clients 102A-Ncan perform technique 400. In block 402, a client can determine theidentity of the source shard on which a particular data item would havebeen located prior to the change in shard quantity. This determinationcan be achieved, for example, by calculating the particular data item'sprimary key modulo the old shard quantity. In block 404, the client candetermine the identity of the destination shard on which the particulardata item is to be located following the change in shard quantity. Thisdetermination can be achieved, for example, by calculating theparticular data item's primary key modulo the new shard quantity. Inblock 406, the client can determine whether the identity of the sourceshard is the same as the identity of the destination shard. If theidentities are the same, then control passes to block 408. Otherwise,control passes to block 410.

In block 408, the client can update the particular data item on thedestination shard in the normal, naïve, highly efficient standard mannerfor performing an update operation. At this point, technique 400terminates.

Alternatively, in block 410, the client can determine whether a dataitem having the particular data item's primary key already exists on thesource shard. If a data item having the particular data item's primarykey already exists on the source shard, then control passes to block416. Otherwise, control passes to block 422.

In block 416, the client can determine whether there already exists, onthe destination shard, a data item having the particular data item'sprimary key. If there already exists, on the destination shard, a dataitem having the particular data item's primary key, then control passesto block 418. Otherwise, control passes to block 420.

In block 418, the client can assign, to the attribute values of the dataitem having the particular data item's primary key (on the destinationshard), the attribute values of the particular data item. Thisassignment essentially updates the data item existing on the destinationshard. The client can assign the system's current version number to thedata item's version number attribute. The client can signify to a userthat the update operation succeeded. At this point, technique 400terminates.

Alternatively, in block 420, the client can insert the particular dataitem into the destination shard. The client can assign the system'scurrent version number to the particular data item's version numberattribute. The client can signify to a user that the update operationsucceeded. At this point, technique 400 terminates.

Alternatively, in block 422, the client can determine whether therealready exists, on the destination shard, a data item having both (a)the particular data item's primary key and (b) a tombstone attributevalue of “false.” If there already exists, on the destination shard, adata item having both (a) the particular data item's primary key and (b)a tombstone attribute value of “false,” then control passes to block418. Otherwise, control passes to block 428.

Alternatively, in block 428, the client can refrain from performing theupdate operation. The client can signify to a user that the updateoperation failed (because there was no data item to update). At thispoint, technique 400 terminates.

Delete Operations

FIG. 5 is a flow diagram that illustrates an example of a technique 500for performing a delete operation while in the rebalancing state,according to an embodiment of the invention. Although technique 500 isillustrated as including specific activities performed in a specificorder, alternative embodiments of the invention can involve techniqueshaving additional, fewer, or different activities. Any of clients 102A-Ncan perform technique 500. In block 502, a client can determine theidentity of the source shard on which a particular data item would havebeen located prior to the change in shard quantity. This determinationcan be achieved, for example, by calculating the particular data item'sprimary key modulo the old shard quantity. In block 504, the client candetermine the identity of the destination shard on which the particulardata item is to be located following the change in shard quantity. Thisdetermination can be achieved, for example, by calculating theparticular data item's primary key modulo the new shard quantity. Inblock 506, the client can determine whether the identity of the sourceshard is the same as the identity of the destination shard. If theidentities are the same, then control passes to block 508. Otherwise,control passes to block 510.

In block 508, the client can delete the particular data item on thedestination shard in the normal, naïve, highly efficient standard mannerfor performing a delete operation. At this point, technique 500terminates.

Alternatively, in block 510, as part of an atomic action, the client candetermine whether a data item having the particular data item's primarykey already exists on the source shard. If a data item having theparticular data item's primary key already exists on the source shard,then control passes to block 512. Otherwise, control passes to block516.

In block 512, as part of the atomic action, the client can upsert theparticular data item into the destination shard. An upsert is definedas: (1) an insert if the object identified by the primary key does notexist in the database (i.e., the destination shard), or (2) an update ifthe object identified by the primary key does exist in the database(i.e., the destination shard). In block 514, as part of the atomicaction, the client can set the value of the particular data item'stombstone attribute to “true.” The client can assign the system'scurrent version number to the particular data item's version numberattribute. The client can signify to a user that the delete operationsucceeded. At this point, technique 500 terminates.

Alternatively, in block 516, the client can determine whether a dataitem having the particular data item's primary key already exists on thedestination shard. If a data item having the particular data item'sprimary key already exists on the destination shard, then control passesto block 518. Otherwise, control passes to block 520.

In block 518, the client can set the value of the data item's tombstoneattribute to “true” (on the destination shard). The client can assignthe system's current version number to the data item's version numberattribute. The client can signify to a user that the delete operationsucceeded. At this point, technique 500 terminates.

Alternatively, in block 520, the client can refrain from performing thedelete operation. The client can signify to a user that the deleteoperation failed (because there was no data item to delete). At thispoint, technique 500 terminates.

Get Operations

FIGS. 6A-6B are flow diagrams that illustrate an example of a technique600 for performing a get operation while in the rebalancing state,according to an embodiment of the invention. In an embodiment, the getoperation can read and return the attribute values of a data item havinga client-specified primary key. Although technique 600 is illustrated asincluding specific activities performed in a specific order, alternativeembodiments of the invention can involve techniques having additional,fewer, or different activities. Any of clients 102A-N can performtechnique 600. Referring first to FIG. 6A, in block 602, a client candetermine the identity of the source shard on which a particular dataitem having a specified primary key would have been located prior to thechange in shard quantity. This determination can be achieved, forexample, by calculating the specified primary key modulo the old shardquantity. In block 604, the client can determine the identity of thedestination shard on which the particular data item having the specifiedprimary key is to be located following the change in shard quantity.This determination can be achieved, for example, by calculating thespecified primary key modulo the new shard quantity. In block 606, theclient can determine whether the identity of the source shard is thesame as the identity of the destination shard. If the identities are thesame, then control passes to block 608. Otherwise, control passes toblock 610.

In block 608, the client can perform a get operation relative to aparticular data item having the specified primary key on the destinationshard in the normal, naïve, highly efficient standard manner forperforming a get operation. At this point, technique 600 terminates.

Alternatively, in block 610, the client can determine whether a dataitem having the specified primary key already exists on the destinationshard. If a data item having the specified primary key already exists onthe destination shard, then control passes to block 612. Otherwise,control passes to block 618.

In block 612, the client can determine whether the data item having thespecified primary key on the destination shard has a “true” tombstoneattribute value. If the data item having the specified primary key onthe destination shard has a “true” tombstone attribute value, thencontrol passes to block 614. Otherwise, control passes to block 616.

In block 614, the client can refrain from performing the get operation.The client can signify to a user that the get operation failed (becauseno data item having the specified primary key was found). At this point,technique 600 terminates.

Alternatively, in block 616, the client can read the attribute values ofthe data having the specified primary key on the destination shard. Theclient can present these attribute values to a user, coincidentallysignifying that the get operation succeeded. At this point, technique600 terminates.

Alternatively, in block 618, the client can determine whether a dataitem having the specified primary key already exists on the sourceshard. If a data item having the specified primary key already exists onthe source shard, then control passes to block 620. Otherwise, controlpasses to block 626 on FIG. 6B.

Alternatively, in block 620, the client can determine whether the dataitem having the specified primary key on the source shard has a “true”tombstone attribute value. If the data item having the specified primarykey on the source shard has a “true” tombstone attribute value, thencontrol passes to block 622. Otherwise, control passes to block 624.

In block 622, the client can refrain from performing the get operation.The client can signify to a user that the get operation failed (becauseno data item having the specified primary key was found). At this point,technique 600 terminates.

Alternatively, in block 624, the client can read the attribute values ofthe data having the specified primary key on the source shard. Theclient can present these attribute values to a user, coincidentallysignifying that the get operation succeeded. At this point, technique600 terminates.

Referring now to FIG. 6B, alternatively, in block 626, the client candetermine (again) whether a data item having the specified primary keynow exists on the destination shard. If a data item having the specifiedprimary key now exists on the destination shard (e.g., as a consequenceof a rebalancing process having recently moved that data item to thedestination shard), then control passes to block 628. Otherwise, controlpasses to block 630.

In block 628, the client can determine whether the data item having thespecified primary key on the destination shard has a “true” tombstoneattribute value. If the data item having the specified primary key onthe destination shard has a “true” tombstone attribute value, thencontrol passes to block 630. Otherwise, control passes to block 632.

In block 630, the client can refrain from performing the get operation.The client can signify to a user that the get operation failed (becauseno data item having the specified primary key was found). At this point,technique 600 terminates.

Alternatively, in block 632, the client can read the attribute values ofthe data having the specified primary key on the destination shard. Theclient can present these attribute values to a user, coincidentallysignifying that the get operation succeeded. At this point, technique600 terminates.

Rebalancing Operations

FIG. 7 is a flow diagram that illustrates an example of a technique 700for performing a rebalancing operation while clients 102A-N are in therebalancing state (initially), according to an embodiment of theinvention. Although technique 700 is illustrated as including specificactivities performed in a specific order, alternative embodiments of theinvention can involve techniques having additional, fewer, or differentactivities. Rebalancing processes can perform technique 700asynchronously to the performance of other types of operations byclients 102A-N.

In block 702, the system's current version number is incremented. Inblock 704, a rebalancing process can determine whether any shard stillcontains a data item whose version number attribute value is less thanthe system's current version number. If a shard contains a particulardata item whose version number attribute value is less than the system'scurrent version number, then control passes to block 706. Otherwise, therebalancing processes have finished relocating data items for thisparticular rebalancing event, and control passes to block 714.

In block 706, the rebalancing process can determine the identity of thedestination shard on which the particular data item is to be locatedfollowing the change in shard quantity. This determination can beachieved, for example, by calculating the particular data item's primarykey modulo the new shard quantity. In block 708, the rebalancing processcan determine whether the identity of a source shard, on which theparticular data item is currently located, is the same as the identityof the destination shard. If the identities are the same, then controlpasses to block 710. Otherwise, control passes to block 712.

In block 710, the rebalancing process can assign the system's currentversion number to the particular data item's version number attribute.Under such circumstances, the particular data item does not need to berelocated to a different shard. Control passes back to block 704.

Alternatively, in block 712, the rebalancing process can insert theparticular data item into the destination shard. In one embodiment,potential conflicts can be ignored. The rebalancing process can assignthe system's current version number to the particular data item'sversion number attribute. Significantly, in an embodiment, an old copyof the particular data item can remain on the source shard until theactivities of blocks 716 and 718 are performed. Control passes back toblock 704.

Alternatively, in block 714, the rebalancing process can determinewhether any queries (e.g., from clients 102A-N) that had been executingas of the time that the rebalancing processes finished relocating dataitems are currently executing against any of the shards (e.g., shards104A-N). If at least one query that had been executing as of the timethat the rebalancing processes finished relocating data items iscurrently executing against at least one shard, then control passes backto block 714. Otherwise, control passes to block 716.

After all queries that were pending as of the conclusion of the dataitem relocation have completed, in block 716, the rebalancing processescan remove, from all shards, all data item copies whose version numberattribute value is less than the system's current version number. Inblock 718, the rebalancing processes can remove, from all shards, alldata item copies whose tombstone attribute values are “true.” In anembodiment, the activities of blocks 716 and 718 can be performed duringcleanup phase 210 discussed above in connection with FIG. 2.

Query Operations

FIG. 8 is a flow diagram that illustrates an example of a technique 800for performing a query operation while in the rebalancing state,according to an embodiment of the invention. Although technique 800 isillustrated as including specific activities performed in a specificorder, alternative embodiments of the invention can involve techniqueshaving additional, fewer, or different activities. Any of clients 102A-Ncan perform technique 800, for example. Technique 800 can be performedconcurrently with technique 700. In block 802, for each particular shardof shards 104A-N, all of the particular shard's data items that satisfyquery-specified filtering criteria can be placed in a separatepreliminary result queue for that particular shard. Each suchpreliminary result queue can start out empty. Thus, a separatepreliminary result queue may be populated for each of shards 104A-N. Inblock 804, for each particular shard of shards 104A-N, the data itemscontained within that particular shard's preliminary result queue can besorted based at least in part on those data items' primary keys. As aresult, for example, each preliminary result queue can contain dataitems that are sorted such that the data item having the smallestprimary key of data items in that preliminary result queue can be at thefront of that preliminary result queue. In block 806, a determinationcan be made as to whether all of the shards' preliminary result queuesare empty. If all of the shards' preliminary result queues are empty,then control passes to block 818. Otherwise, control passes to block808.

In block 808, from the set of data items that are currently at the topof each shard's preliminary result queue, a subset of one or more dataitems having the smallest primary key among data items in that set canbe selected. In block 810, from the subset of one or more data itemsselected in block 808, a particular data item having the largest versionnumber attribute value can be selected. In block 812, a determinationcan be made as to whether the particular data item's tombstone attributevalue is “false.” If the particular data item's tombstone attributevalue is “false,” then control passes to block 814. Otherwise, controlpasses to block 816.

In block 814, the particular data item can be added to a final resultset. The final result set can start out empty. Control passes to block816. In block 816, all data item copies having the same primary key asthe particular data item (including the particular data item itself) canbe removed from all of the shards' preliminary result queues. Thisremoval potentially can cause other data items to rise to the top of oneor more of those queues. Control passes back to block 806.

Alternatively, in block 818, the data items in the final result set canbe returned as the final results of the query operation.

Hardware Overview

FIG. 9 depicts a simplified diagram of a distributed system 900 forimplementing one of the embodiments. In the illustrated embodiment,distributed system 900 includes one or more client computing devices902, 904, 906, and 908, which are configured to execute and operate aclient application such as a web browser, proprietary client (e.g.,Oracle Forms), or the like over one or more network(s) 910. Server 912may be communicatively coupled with remote client computing devices 902,904, 906, and 908 via network 910.

In various embodiments, server 912 may be adapted to run one or moreservices or software applications provided by one or more of thecomponents of the system. In some embodiments, these services may beoffered as web-based or cloud services or under a Software as a Service(SaaS) model to the users of client computing devices 902, 904, 906,and/or 908. Users operating client computing devices 902, 904, 906,and/or 908 may in turn utilize one or more client applications tointeract with server 912 to utilize the services provided by thesecomponents.

In the configuration depicted in the figure, the software components918, 920 and 922 of system 900 are shown as being implemented on server912. In other embodiments, one or more of the components of system 900and/or the services provided by these components may also be implementedby one or more of the client computing devices 902, 904, 906, and/or908. Users operating the client computing devices may then utilize oneor more client applications to use the services provided by thesecomponents. These components may be implemented in hardware, firmware,software, or combinations thereof. It should be appreciated that variousdifferent system configurations are possible, which may be differentfrom distributed system 900. The embodiment shown in the figure is thusone example of a distributed system for implementing an embodimentsystem and is not intended to be limiting.

Client computing devices 902, 904, 906, and/or 908 may be portablehandheld devices (e.g., an iPhone®, cellular telephone, an iPad®,computing tablet, a personal digital assistant (PDA)) or wearabledevices (e.g., a Google Glass® head mounted display), running softwaresuch as Microsoft Windows Mobile®, and/or a variety of mobile operatingsystems such as iOS, Windows Phone, Android, BlackBerry 10, Palm OS, andthe like, and being Internet, e-mail, short message service (SMS),Blackberry®, or other communication protocol enabled. The clientcomputing devices can be general purpose personal computers including,by way of example, personal computers and/or laptop computers runningvarious versions of Microsoft Windows®, Apple Macintosh®, and/or Linuxoperating systems. The client computing devices can be workstationcomputers running any of a variety of commercially-available UNIX® orUNIX-like operating systems, including without limitation the variety ofGNU/Linux operating systems, such as for example, Google Chrome OS.Alternatively, or in addition, client computing devices 902, 904, 906,and 908 may be any other electronic device, such as a thin-clientcomputer, an Internet-enabled gaming system (e.g., a Microsoft Xboxgaming console with or without a Kinect® gesture input device), and/or apersonal messaging device, capable of communicating over network(s) 910.

Although exemplary distributed system 900 is shown with four clientcomputing devices, any number of client computing devices may besupported. Other devices, such as devices with sensors, etc., mayinteract with server 912.

Network(s) 910 in distributed system 900 may be any type of networkfamiliar to those skilled in the art that can support datacommunications using any of a variety of commercially-availableprotocols, including without limitation TCP/IP (transmission controlprotocol/Internet protocol), SNA (systems network architecture), IPX(Internet packet exchange), AppleTalk, and the like. Merely by way ofexample, network(s) 910 can be a local area network (LAN), such as onebased on Ethernet, Token-Ring and/or the like. Network(s) 910 can be awide-area network and the Internet. It can include a virtual network,including without limitation a virtual private network (VPN), anintranet, an extranet, a public switched telephone network (PSTN), aninfra-red network, a wireless network (e.g., a network operating underany of the Institute of Electrical and Electronics (IEEE) 902.11 suiteof protocols, Bluetooth®, and/or any other wireless protocol); and/orany combination of these and/or other networks.

Server 912 may be composed of one or more general purpose computers,specialized server computers (including, by way of example, PC (personalcomputer) servers, UNIXO servers, mid-range servers, mainframecomputers, rack-mounted servers, etc.), server farms, server clusters,or any other appropriate arrangement and/or combination. In variousembodiments, server 912 may be adapted to run one or more services orsoftware applications described in the foregoing disclosure. Forexample, server 912 may correspond to a server for performing processingdescribed above according to an embodiment of the present disclosure.

Server 912 may run an operating system including any of those discussedabove, as well as any commercially available server operating system.Server 912 may also run any of a variety of additional serverapplications and/or mid-tier applications, including HTTP (hypertexttransport protocol) servers, FTP (file transfer protocol) servers, CGI(common gateway interface) servers, JAVA® servers, database servers, andthe like. Exemplary database servers include without limitation thosecommercially available from Oracle, Microsoft, Sybase, IBM(International Business Machines), and the like.

In some implementations, server 912 may include one or more applicationsto analyze and consolidate data feeds and/or event updates received fromusers of client computing devices 902, 904, 906, and 908. As an example,data feeds and/or event updates may include, but are not limited to,Twitter® feeds, Facebook® updates or real-time updates received from oneor more third party information sources and continuous data streams,which may include real-time events related to sensor data applications,financial tickers, network performance measuring tools (e.g., networkmonitoring and traffic management applications), clickstream analysistools, automobile traffic monitoring, and the like. Server 912 may alsoinclude one or more applications to display the data feeds and/orreal-time events via one or more display devices of client computingdevices 902, 904, 906, and 908.

Distributed system 900 may also include one or more databases 914 and916. Databases 914 and 916 may reside in a variety of locations. By wayof example, one or more of databases 914 and 916 may reside on anon-transitory storage medium local to (and/or resident in) server 912.Alternatively, databases 914 and 916 may be remote from server 912 andin communication with server 912 via a network-based or dedicatedconnection. In one set of embodiments, databases 914 and 916 may residein a storage-area network (SAN). Similarly, any necessary files forperforming the functions attributed to server 912 may be stored locallyon server 912 and/or remotely, as appropriate. In one set ofembodiments, databases 914 and 916 may include relational databases,such as databases provided by Oracle, which are adapted to store,update, and retrieve data in response to SQL-formatted commands.

FIG. 10 is a simplified block diagram of one or more components of asystem environment 1000 by which services provided by one or morecomponents of an embodiment system may be offered as cloud services, inaccordance with an embodiment of the present disclosure. In theillustrated embodiment, system environment 1000 includes one or moreclient computing devices 1004, 1006, and 1008 that may be used by usersto interact with a cloud infrastructure system 1002 that provides cloudservices. The client computing devices may be configured to operate aclient application such as a web browser, a proprietary clientapplication (e.g., Oracle Forms), or some other application, which maybe used by a user of the client computing device to interact with cloudinfrastructure system 1002 to use services provided by cloudinfrastructure system 1002.

It should be appreciated that cloud infrastructure system 1002 depictedin the figure may have other components than those depicted. Further,the embodiment shown in the figure is only one example of a cloudinfrastructure system that may incorporate an embodiment of theinvention. In some other embodiments, cloud infrastructure system 1002may have more or fewer components than shown in the figure, may combinetwo or more components, or may have a different configuration orarrangement of components.

Client computing devices 1004, 1006, and 1008 may be devices similar tothose described above for 902, 904, 906, and 908.

Although exemplary system environment 1000 is shown with three clientcomputing devices, any number of client computing devices may besupported. Other devices such as devices with sensors, etc. may interactwith cloud infrastructure system 1002.

Network(s) 1010 may facilitate communications and exchange of databetween clients 1004, 1006, and 1008 and cloud infrastructure system1002. Each network may be any type of network familiar to those skilledin the art that can support data communications using any of a varietyof commercially-available protocols, including those described above fornetwork(s) 910.

Cloud infrastructure system 1002 may comprise one or more computersand/or servers that may include those described above for server 912.

In certain embodiments, services provided by the cloud infrastructuresystem may include a host of services that are made available to usersof the cloud infrastructure system on demand, such as online datastorage and backup solutions, Web-based e-mail services, hosted officesuites and document collaboration services, database processing, managedtechnical support services, and the like. Services provided by the cloudinfrastructure system can dynamically scale to meet the needs of itsusers. A specific instantiation of a service provided by cloudinfrastructure system is referred to herein as a “service instance.” Ingeneral, any service made available to a user via a communicationnetwork, such as the Internet, from a cloud service provider's system isreferred to as a “cloud service.” Typically, in a public cloudenvironment, servers and systems that make up the cloud serviceprovider's system are different from the customer's own on-premisesservers and systems. For example, a cloud service provider's system mayhost an application, and a user may, via a communication network such asthe Internet, on demand, order and use the application.

In some examples, a service in a computer network cloud infrastructuremay include protected computer network access to storage, a hosteddatabase, a hosted web server, a software application, or other serviceprovided by a cloud vendor to a user, or as otherwise known in the art.For example, a service can include password-protected access to remotestorage on the cloud through the Internet. As another example, a servicecan include a web service-based hosted relational database and ascript-language middleware engine for private use by a networkeddeveloper. As another example, a service can include access to an emailsoftware application hosted on a cloud vendor's web site.

In certain embodiments, cloud infrastructure system 1002 may include asuite of applications, middleware, and database service offerings thatare delivered to a customer in a self-service, subscription-based,elastically scalable, reliable, highly available, and secure manner. Anexample of such a cloud infrastructure system is the Oracle Public Cloudprovided by the present assignee.

In various embodiments, cloud infrastructure system 1002 may be adaptedto automatically provision, manage and track a customer's subscriptionto services offered by cloud infrastructure system 1002. Cloudinfrastructure system 1002 may provide the cloud services via differentdeployment models. For example, services may be provided under a publiccloud model in which cloud infrastructure system 1002 is owned by anorganization selling cloud services (e.g., owned by Oracle) and theservices are made available to the general public or different industryenterprises. As another example, services may be provided under aprivate cloud model in which cloud infrastructure system 1002 isoperated solely for a single organization and may provide services forone or more entities within the organization. The cloud services mayalso be provided under a community cloud model in which cloudinfrastructure system 1002 and the services provided by cloudinfrastructure system 1002 are shared by several organizations in arelated community. The cloud services may also be provided under ahybrid cloud model, which is a combination of two or more differentmodels.

In some embodiments, the services provided by cloud infrastructuresystem 1002 may include one or more services provided under Software asa Service (SaaS) category, Platform as a Service (PaaS) category,Infrastructure as a Service (IaaS) category, or other categories ofservices including hybrid services. A customer, via a subscriptionorder, may order one or more services provided by cloud infrastructuresystem 1002. Cloud infrastructure system 1002 then performs processingto provide the services in the customer's subscription order.

In some embodiments, the services provided by cloud infrastructuresystem 1002 may include, without limitation, application services,platform services and infrastructure services. In some examples,application services may be provided by the cloud infrastructure systemvia a SaaS platform. The SaaS platform may be configured to providecloud services that fall under the SaaS category. For example, the SaaSplatform may provide capabilities to build and deliver a suite ofon-demand applications on an integrated development and deploymentplatform. The SaaS platform may manage and control the underlyingsoftware and infrastructure for providing the SaaS services. Byutilizing the services provided by the SaaS platform, customers canutilize applications executing on the cloud infrastructure system.Customers can acquire the application services without the need forcustomers to purchase separate licenses and support. Various differentSaaS services may be provided. Examples include, without limitation,services that provide solutions for sales performance management,enterprise integration, and business flexibility for largeorganizations.

In some embodiments, platform services may be provided by the cloudinfrastructure system via a PaaS platform. The PaaS platform may beconfigured to provide cloud services that fall under the PaaS category.Examples of platform services may include without limitation servicesthat enable organizations (such as Oracle) to consolidate existingapplications on a shared, common architecture, as well as the ability tobuild new applications that leverage the shared services provided by theplatform. The PaaS platform may manage and control the underlyingsoftware and infrastructure for providing the PaaS services. Customerscan acquire the PaaS services provided by the cloud infrastructuresystem without the need for customers to purchase separate licenses andsupport. Examples of platform services include, without limitation,Oracle Java Cloud Service (JCS), Oracle Database Cloud Service (DBCS),and others.

By utilizing the services provided by the PaaS platform, customers canemploy programming languages and tools supported by the cloudinfrastructure system and also control the deployed services. In someembodiments, platform services provided by the cloud infrastructuresystem may include database cloud services, middleware cloud services(e.g., Oracle Fusion Middleware services), and Java cloud services. Inone embodiment, database cloud services may support shared servicedeployment models that enable organizations to pool database resourcesand offer customers a Database as a Service in the form of a databasecloud. Middleware cloud services may provide a platform for customers todevelop and deploy various business applications, and Java cloudservices may provide a platform for customers to deploy Javaapplications, in the cloud infrastructure system.

Various different infrastructure services may be provided by an IaaSplatform in the cloud infrastructure system. The infrastructure servicesfacilitate the management and control of the underlying computingresources, such as storage, networks, and other fundamental computingresources for customers utilizing services provided by the SaaS platformand the PaaS platform.

In certain embodiments, cloud infrastructure system 1002 may alsoinclude infrastructure resources 1030 for providing the resources usedto provide various services to customers of the cloud infrastructuresystem. In one embodiment, infrastructure resources 1030 may includepre-integrated and optimized combinations of hardware, such as servers,storage, and networking resources to execute the services provided bythe PaaS platform and the SaaS platform.

In some embodiments, resources in cloud infrastructure system 1002 maybe shared by multiple users and dynamically re-allocated per demand.Additionally, resources may be allocated to users in different timezones. For example, cloud infrastructure system 1030 may enable a firstset of users in a first time zone to utilize resources of the cloudinfrastructure system for a specified number of hours and then enablethe re-allocation of the same resources to another set of users locatedin a different time zone, thereby maximizing the utilization ofresources.

In certain embodiments, a number of internal shared services 1032 may beprovided that are shared by different components or modules of cloudinfrastructure system 1002 and by the services provided by cloudinfrastructure system 1002. These internal shared services may include,without limitation, a security and identity service, an integrationservice, an enterprise repository service, an enterprise managerservice, a virus scanning and white list service, a high availability,backup and recovery service, service for enabling cloud support, anemail service, a notification service, a file transfer service, and thelike.

In certain embodiments, cloud infrastructure system 1002 may providecomprehensive management of cloud services (e.g., SaaS, PaaS, and IaaSservices) in the cloud infrastructure system. In one embodiment, cloudmanagement functionality may include capabilities for provisioning,managing and tracking a customer's subscription received by cloudinfrastructure system 1002, and the like.

In one embodiment, as depicted in the figure, cloud managementfunctionality may be provided by one or more modules, such as an ordermanagement module 1020, an order orchestration module 1022, an orderprovisioning module 1024, an order management and monitoring module1026, and an identity management module 1028. These modules may includeor be provided using one or more computers and/or servers, which may begeneral purpose computers, specialized server computers, server farms,server clusters, or any other appropriate arrangement and/orcombination.

In exemplary operation 1034, a customer using a client device, such asclient device 1004, 1006 or 1008, may interact with cloud infrastructuresystem 1002 by requesting one or more services provided by cloudinfrastructure system 1002 and placing an order for a subscription forone or more services offered by cloud infrastructure system 1002. Incertain embodiments, the customer may access a cloud User Interface(UI), cloud UI 1012, cloud UI 1014 and/or cloud UI 1016 and place asubscription order via these UIs. The order information received bycloud infrastructure system 1002 in response to the customer placing anorder may include information identifying the customer and one or moreservices offered by the cloud infrastructure system 1002 that thecustomer intends to subscribe to.

After an order has been placed by the customer, the order information isreceived via the cloud UIs, 1012, 1014 and/or 1016.

At operation 1036, the order is stored in order database 1018. Orderdatabase 1018 can be one of several databases operated by cloudinfrastructure system 1018 and operated in conjunction with other systemelements.

At operation 1038, the order information is forwarded to an ordermanagement module 1020. In some instances, order management module 1020may be configured to perform billing and accounting functions related tothe order, such as verifying the order, and upon verification, bookingthe order.

At operation 1040, information regarding the order is communicated to anorder orchestration module 1022. Order orchestration module 1022 mayutilize the order information to orchestrate the provisioning ofservices and resources for the order placed by the customer. In someinstances, order orchestration module 1022 may orchestrate theprovisioning of resources to support the subscribed services using theservices of order provisioning module 1024.

In certain embodiments, order orchestration module 1022 enables themanagement of business processes associated with each order and appliesbusiness logic to determine whether an order should proceed toprovisioning. At operation 1042, upon receiving an order for a newsubscription, order orchestration module 1022 sends a request to orderprovisioning module 1024 to allocate resources and configure thoseresources needed to fulfill the subscription order. Order provisioningmodule 1024 enables the allocation of resources for the services orderedby the customer. Order provisioning module 1024 provides a level ofabstraction between the cloud services provided by cloud infrastructuresystem 1000 and the physical implementation layer that is used toprovision the resources for providing the requested services. Orderorchestration module 1022 may thus be isolated from implementationdetails, such as whether or not services and resources are actuallyprovisioned on the fly or pre-provisioned and only allocated/assignedupon request.

At operation 1044, once the services and resources are provisioned, anotification of the provided service may be sent to customers on clientdevices 1004, 1006 and/or 1008 by order provisioning module 1024 ofcloud infrastructure system 1002.

At operation 1046, the customer's subscription order may be managed andtracked by an order management and monitoring module 1026. In someinstances, order management and monitoring module 1026 may be configuredto collect usage statistics for the services in the subscription order,such as the amount of storage used, the amount data transferred, thenumber of users, and the amount of system up time and system down time.

In certain embodiments, cloud infrastructure system 1000 may include anidentity management module 1028. Identity management module 1028 may beconfigured to provide identity services, such as access management andauthorization services in cloud infrastructure system 1000. In someembodiments, identity management module 1028 may control informationabout customers who wish to utilize the services provided by cloudinfrastructure system 1002. Such information can include informationthat authenticates the identities of such customers and information thatdescribes which actions those customers are authorized to performrelative to various system resources (e.g., files, directories,applications, communication ports, memory segments, etc.) Identitymanagement module 1028 may also include the management of descriptiveinformation about each customer and about how and by whom thatdescriptive information can be accessed and modified.

FIG. 11 illustrates an example computer system 1100 in which variousembodiments of the present invention may be implemented. The system 1100may be used to implement any of the computer systems described above. Asshown in the figure, computer system 1100 includes a processing unit1104 that communicates with a number of peripheral subsystems via a bussubsystem 1102. These peripheral subsystems may include a processingacceleration unit 1106, an I/O subsystem 1108, a storage subsystem 1118and a communications subsystem 1124. Storage subsystem 1118 includestangible computer-readable storage media 1122 and a system memory 1110.

Bus subsystem 1102 provides a mechanism for letting the variouscomponents and subsystems of computer system 1100 communicate with eachother as intended. Although bus subsystem 1102 is shown schematically asa single bus, alternative embodiments of the bus subsystem may utilizemultiple buses. Bus subsystem 1102 may be any of several types of busstructures including a memory bus or memory controller, a peripheralbus, and a local bus using any of a variety of bus architectures. Forexample, such architectures may include an Industry StandardArchitecture (ISA) bus, Micro Channel Architecture (MCA) bus, EnhancedISA (EISA) bus, Video Electronics Standards Association (VESA) localbus, and Peripheral Component Interconnect (PCI) bus, which can beimplemented as a Mezzanine bus manufactured to the IEEE P1386.1standard.

Processing unit 1104, which can be implemented as one or more integratedcircuits (e.g., a conventional microprocessor or microcontroller),controls the operation of computer system 1100. One or more processorsmay be included in processing unit 1104. These processors may includesingle core or multicore processors. In certain embodiments, processingunit 1104 may be implemented as one or more independent processing units1132 and/or 1134 with single or multicore processors included in eachprocessing unit. In other embodiments, processing unit 1104 may also beimplemented as a quad-core processing unit formed by integrating twodual-core processors into a single chip.

In various embodiments, processing unit 1104 can execute a variety ofprograms in response to program code and can maintain multipleconcurrently executing programs or processes. At any given time, some orall of the program code to be executed can be resident in processor(s)1104 and/or in storage subsystem 1118. Through suitable programming,processor(s) 1104 can provide various functionalities described above.Computer system 1100 may additionally include a processing accelerationunit 1106, which can include a digital signal processor (DSP), aspecial-purpose processor, and/or the like.

I/O subsystem 1108 may include user interface input devices and userinterface output devices. User interface input devices may include akeyboard, pointing devices such as a mouse or trackball, a touchpad ortouch screen incorporated into a display, a scroll wheel, a click wheel,a dial, a button, a switch, a keypad, audio input devices with voicecommand recognition systems, microphones, and other types of inputdevices. User interface input devices may include, for example, motionsensing and/or gesture recognition devices such as the Microsoft Kinect®motion sensor that enables users to control and interact with an inputdevice, such as the Microsoft Xbox® 360 game controller, through anatural user interface using gestures and spoken commands. Userinterface input devices may also include eye gesture recognition devicessuch as the Google Glass® blink detector that detects eye activity(e.g., ‘blinking’ while taking pictures and/or making a menu selection)from users and transforms the eye gestures as input into an input device(e.g., Google Glass®). Additionally, user interface input devices mayinclude voice recognition sensing devices that enable users to interactwith voice recognition systems (e.g., Siri® navigator), through voicecommands.

User interface input devices may also include, without limitation, threedimensional (3D) mice, joysticks or pointing sticks, gamepads andgraphic tablets, and audio/visual devices such as speakers, digitalcameras, digital camcorders, portable media players, webcams, imagescanners, fingerprint scanners, barcode reader 3D scanners, 3D printers,laser rangefinders, and eye gaze tracking devices. Additionally, userinterface input devices may include, for example, medical imaging inputdevices such as computed tomography, magnetic resonance imaging,position emission tomography, medical ultrasonography devices. Userinterface input devices may also include, for example, audio inputdevices such as MIDI keyboards, digital musical instruments and thelike.

User interface output devices may include a display subsystem, indicatorlights, or non-visual displays such as audio output devices, etc. Thedisplay subsystem may be a cathode ray tube (CRT), a flat-panel device,such as that using a liquid crystal display (LCD) or plasma display, aprojection device, a touch screen, and the like. In general, use of theterm “output device” is intended to include all possible types ofdevices and mechanisms for outputting information from computer system1100 to a user or other computer. For example, user interface outputdevices may include, without limitation, a variety of display devicesthat visually convey text, graphics and audio/video information such asmonitors, printers, speakers, headphones, automotive navigation systems,plotters, voice output devices, and modems.

Computer system 1100 may comprise a storage subsystem 1118 thatcomprises software elements, shown as being currently located within asystem memory 1110. System memory 1110 may store program instructionsthat are loadable and executable on processing unit 1104, as well asdata generated during the execution of these programs.

Depending on the configuration and type of computer system 1100, systemmemory 1110 may be volatile (such as random access memory (RAM)) and/ornon-volatile (such as read-only memory (ROM), flash memory, etc.) TheRAM typically contains data and/or program modules that are immediatelyaccessible to and/or presently being operated and executed by processingunit 1104. In some implementations, system memory 1110 may includemultiple different types of memory, such as static random access memory(SRAM) or dynamic random access memory (DRAM). In some implementations,a basic input/output system (BIOS), containing the basic routines thathelp to transfer information between elements within computer system1100, such as during start-up, may typically be stored in the ROM. Byway of example, and not limitation, system memory 1110 also illustratesapplication programs 1112, which may include client applications, Webbrowsers, mid-tier applications, relational database management systems(RDBMS), etc., program data 1114, and an operating system 1116. By wayof example, operating system 1116 may include various versions ofMicrosoft Windows®, Apple Macintosh®, and/or Linux operating systems, avariety of commercially-available UNIX® or UNIX-like operating systems(including without limitation the variety of GNU/Linux operatingsystems, the Google Chrome® OS, and the like) and/or mobile operatingsystems such as iOS, Windows® Phone, Android® OS, BlackBerry® 11 OS, andPalm® OS operating systems.

Storage subsystem 1118 may also provide a tangible computer-readablestorage medium for storing the basic programming and data constructsthat provide the functionality of some embodiments. Software (programs,code modules, instructions) that when executed by a processor providethe functionality described above may be stored in storage subsystem1118. These software modules or instructions may be executed byprocessing unit 1104. Storage subsystem 1118 may also provide arepository for storing data used in accordance with the presentinvention.

Storage subsystem 1100 may also include a computer-readable storagemedia reader 1120 that can further be connected to computer-readablestorage media 1122. Together and, optionally, in combination with systemmemory 1110, computer-readable storage media 1122 may comprehensivelyrepresent remote, local, fixed, and/or removable storage devices plusstorage media for temporarily and/or more permanently containing,storing, transmitting, and retrieving computer-readable information.

Computer-readable storage media 1122 containing code, or portions ofcode, can also include any appropriate media known or used in the art,including storage media and communication media, such as but not limitedto, volatile and non-volatile, removable and non-removable mediaimplemented in any method or technology for storage and/or transmissionof information. This can include tangible computer-readable storagemedia such as RAM, ROM, electronically erasable programmable ROM(EEPROM), flash memory or other memory technology, CD-ROM, digitalversatile disk (DVD), or other optical storage, magnetic cassettes,magnetic tape, magnetic disk storage or other magnetic storage devices,or other tangible computer readable media. This can also includenontangible computer-readable media, such as data signals, datatransmissions, or any other medium which can be used to transmit thedesired information and which can be accessed by computing system 1100.

By way of example, computer-readable storage media 1122 may include ahard disk drive that reads from or writes to non-removable, nonvolatilemagnetic media, a magnetic disk drive that reads from or writes to aremovable, nonvolatile magnetic disk, and an optical disk drive thatreads from or writes to a removable, nonvolatile optical disk such as aCD ROM, DVD, and Blu-Ray® disk, or other optical media.Computer-readable storage media 1122 may include, but is not limited to,Zip® drives, flash memory cards, universal serial bus (USB) flashdrives, secure digital (SD) cards, DVD disks, digital video tape, andthe like. Computer-readable storage media 1122 may also include,solid-state drives (SSD) based on non-volatile memory such asflash-memory based SSDs, enterprise flash drives, solid state ROM, andthe like, SSDs based on volatile memory such as solid state RAM, dynamicRAM, static RAM, DRAM-based SSDs, magnetoresistive RAM (MRAM) SSDs, andhybrid SSDs that use a combination of DRAM and flash memory based SSDs.The disk drives and their associated computer-readable media may providenon-volatile storage of computer-readable instructions, data structures,program modules, and other data for computer system 1100.

Communications subsystem 1124 provides an interface to other computersystems and networks. Communications subsystem 1124 serves as aninterface for receiving data from and transmitting data to other systemsfrom computer system 1100. For example, communications subsystem 1124may enable computer system 1100 to connect to one or more devices viathe Internet. In some embodiments communications subsystem 1124 caninclude radio frequency (RF) transceiver components for accessingwireless voice and/or data networks (e.g., using cellular telephonetechnology, advanced data network technology, such as 3G, 4G or EDGE(enhanced data rates for global evolution), WiFi (IEEE 802.11 familystandards, or other mobile communication technologies, or anycombination thereof), global positioning system (GPS) receivercomponents, and/or other components. In some embodiments communicationssubsystem 1124 can provide wired network connectivity (e.g., Ethernet)in addition to or instead of a wireless interface.

In some embodiments, communications subsystem 1124 may also receiveinput communication in the form of structured and/or unstructured datafeeds 1126, event streams 1128, event updates 1130, and the like onbehalf of one or more users who may use computer system 1100.

By way of example, communications subsystem 1124 may be configured toreceive data feeds 1126 in real-time from users of social networksand/or other communication services such as Twitter® feeds, Facebook®updates, web feeds such as Rich Site Summary (RSS) feeds, and/orreal-time updates from one or more third party information sources.

Additionally, communications subsystem 1124 may also be configured toreceive data in the form of continuous data streams, which may includeevent streams 1128 of real-time events and/or event updates 1130, whichmay be continuous or unbounded in nature with no explicit end. Examplesof applications that generate continuous data may include, for example,sensor data applications, financial tickers, network performancemeasuring tools (e.g. network monitoring and traffic managementapplications), clickstream analysis tools, automobile trafficmonitoring, and the like. Communications subsystem 1124 may also beconfigured to output the structured and/or unstructured data feeds 1126,event streams 1128, event updates 1130, and the like to one or moredatabases that may be in communication with one or more streaming datasource computers coupled to computer system 1100.

Computer system 1100 can be one of various types, including a handheldportable device (e.g., an iPhone® cellular phone, an iPad® computingtablet, a PDA), a wearable device (e.g., a Google Glass® head mounteddisplay), a PC, a workstation, a mainframe, a kiosk, a server rack, orany other data processing system.

Due to the ever-changing nature of computers and networks, thedescription of computer system 1100 depicted in the figure is intendedonly as a specific example. Many other configurations having more orfewer components than the system depicted in the figure are possible.For example, customized hardware might also be used and/or particularelements might be implemented in hardware, firmware, software (includingapplets), or a combination. Further, connection to other computingdevices, such as network input/output devices, may be employed. Based onthe disclosure and teachings provided herein, a person of ordinary skillin the art will appreciate other ways and/or methods to implement thevarious embodiments. In the foregoing specification, aspects of theinvention are described with reference to specific embodiments thereof,but those skilled in the art will recognize that the invention is notlimited thereto. Various features and aspects of the above-describedinvention may be used individually or jointly. Further, embodiments canbe utilized in any number of environments and applications beyond thosedescribed herein without departing from the broader spirit and scope ofthe specification. The specification and drawings are, accordingly, tobe regarded as illustrative rather than restrictive.

What is claimed is:
 1. A computer-implemented method comprising:determining a change in a quantity of shards in a multi-shard systemthat has a plurality of shards; in response to determining the change inthe quantity of shards, transitioning a client from a normal state to arebalancing state, wherein during the normal state, the client performsa type of operation relative to data items stored in the multi-shardsystem in a first manner, wherein during the rebalancing state, theclient performs the type of operation relative to the data items storedin the multi-shard system in a second manner, wherein the second manneris different than the first manner, wherein during the rebalancingstate, the client performs the type of operation without the clientacquiring one or more exclusive locks relative to any of the data items,and wherein during the rebalancing state, the type of operation isperformed based on: a first shard in the multi-shard system, the firstshard including a data item stored at a first memory location in thefirst shard before the change in the quantity of shards, wherein thedata item is one of the data items; and a second shard in themulti-shard system, the second shard including the data item stored at asecond memory location in the second shard after the change in thequantity of shards; while the client is in the rebalancing state,determining, for one or more data items of the data items, one or moredestination shards that are separate from one or more source shards,wherein the one or more source shards store the one or more data itemsduring the normal state prior to transitioning the client from thenormal state to the rebalancing state; and moving the one or more dataitems from the one or more source shards to the one or more destinationshards while the client is in the rebalancing state.
 2. Thecomputer-implemented method of claim 1, further comprising: while theone or more data items are being moved from the one or more sourceshards to the one or more destination shards, the client performing,asynchronously to the moving of the one or more data items, and relativeto a data item, an operation of the type of operation in the secondmanner without acquiring an exclusive lock.
 3. The computer-implementedmethod of claim 1, further comprising: determining the one or moredestination shards for the one or more data items by hashing primarykeys of the data items based at least in part on the quantity of shardsin the multi-shard system following the change in the quantity ofshards; and in response to determining that the one or more data itemshave been moved from the one or more source shards to the one or moredestination shards, transitioning the client from the rebalancing stateto the normal state.
 4. The computer-implemented method of claim 1,further comprising: while the one or more data items are being movedfrom the one or more source shards to the one or more destinationshards, the client performing an add operation in the second mannerrelative to a first data item having a primary key at least in part by:determining, based at least in part on a quantity of shards in themulti-shard system preceding the change in the quantity of shards, aparticular source shard on which the first data item is stored prior tothe change in the quantity of shards; determining, based at least inpart on a quantity of shards in the multi-shard system following thechange in the quantity of shards, a particular destination shard onwhich the first data item is to be added after the change in thequantity of shards; determining that no data item on the source shardhas the primary key of the first data item; determining that no dataitem on the destination shard has both a true tombstone attribute valueand the primary key of the first data item; and inserting the first dataitem into the destination shard.
 5. The computer-implemented method ofclaim 1, further comprising: while the one or more data items are beingmoved from the source shards to the destination shards, the clientperforming an add operation in the second manner relative to a firstdata item having a primary key at least in part by: determining, basedat least in part on a quantity of shards in the multi-shard systempreceding the change in the quantity of shards, a particular sourceshard on which the first data item is stored prior to the change in thequantity of shards; determining, based at least in part on a quantity ofshards in the multi-shard system following the change in the quantity ofshards, a particular destination shard on which the first data item isto be added after the change in the quantity of shards; determining thatno data item on the source shard has the first data item's primary key;determining that a second data item on the destination shard has both atrue tombstone attribute value and the first data item's primary key;assigning, to one or more attributes of the second data item, attributevalues of the first data item; and setting the second data item'stombstone attribute value to false.
 6. The computer-implemented methodof claim 1, further comprising: while the one or more data items arebeing moved from the source shards to the destination shards, the clientperforming an update type of operation in the second manner relative toa first data item having a primary key at least in part by: determining,based at least in part on a quantity of shards in the multi-shard systempreceding the change in the quantity of shards, a particular sourceshard on which the first data item is stored prior to the change in thequantity of shards; determining, based at least in part on a quantity ofshards in the multi-shard system following the change in the quantity ofshards, a particular destination shard on which the first data item isto be located after the change in the quantity of shards; determiningthat no data item on the source shard has the first data item's primarykey; determining that a second data item on the destination shard hasboth a false tombstone attribute value and the first data item's primarykey; and assigning, to one or more attributes of the second data item,attribute values of the first data item.
 7. The computer-implementedmethod of claim 1, further comprising: while the one or more data itemsare being moved from the source shards to the destination shards, theclient performing an update type of operation in the second mannerrelative to a first data item having a primary key at least in part by:determining, based at least in part on a quantity of shards in themulti-shard system preceding the change in the quantity of shards, aparticular source shard on which the first data item is stored prior tothe change in the quantity of shards; determining, based at least inpart on a quantity of shards in the multi-shard system following thechange in the quantity of shards, a particular destination shard onwhich the first data item is to be located after the change in thequantity of shards; determining that a second data item on the sourceshard has both the first data item's primary key and a false tombstoneattribute value; determining that a third data item on the destinationshard has the first data item's primary key; assigning, to one or moreattributes of the third data item, attribute values of the first dataitem; and setting a version number of the third data item to a valuedifferent from a version number of the second data item.
 8. Thecomputer-implemented method of claim 1, further comprising: while theone or more data items are being moved from the source shards to thedestination shards, the client performing an update type of operation inthe second manner relative to a first data item having a primary key atleast in part by: determining, based at least in part on a quantity ofshards in the multi-shard system preceding the change in the quantity ofshards, a particular source shard on which the first data item is storedprior to the change in the quantity of shards; determining, based atleast in part on a quantity of shards in the multi-shard systemfollowing the change in the quantity of shards, a particular destinationshard on which the first data item is to be located after the change inthe quantity of shards; determining that a second data item on thesource shard has both the first data item's primary key and a falsetombstone attribute value; determining no data item on the destinationshard has the first data item's primary key; and inserting the firstdata item into the destination shard with a version number that differsfrom a version number of the second data item.
 9. Thecomputer-implemented method of claim 1, further comprising: while theone or more data items are being moved from the source shards to thedestination shards, the client performing a delete type of operation inthe second manner relative to a first data item having a primary key atleast in part by: determining, based at least in part on a quantity ofshards in the multi-shard system preceding the change in the quantity ofshards, a particular source shard on which the first data item is storedprior to the change in the quantity of shards; determining, based atleast in part on a quantity of shards in the multi-shard systemfollowing the change in the quantity of shards, a particular destinationshard on which the first data item is to be located after the change inthe quantity of shards; determining that a second data item on thesource shard has the first data item's primary key; upserting the firstdata item into the destination shard with a version number that differsfrom a version number of the second data item; and setting a tombstoneattribute value of the first data item on the destination shard to true.10. The computer-implemented method of claim 1, further comprising:while the one or more data items are being moved from the source shardsto the destination shards, the client performing a delete type ofoperation in the second manner relative to a first data item having aprimary key at least in part by: determining, based at least in part ona quantity of shards in the multi-shard system preceding the change inthe quantity of shards, a particular source shard on which the firstdata item is stored prior to the change in the quantity of shards;determining, based at least in part on a quantity of shards in themulti-shard system following the change in the quantity of shards, aparticular destination shard on which the first data item is to belocated after the change in the quantity of shards; determining that nodata item on the source shard has the first data item's primary key;determining that a second data item on the destination shard has thefirst data item's primary key; and setting a tombstone attribute valueof the second data item to true.
 11. The computer-implemented method ofclaim 1, further comprising: while the one or more data items are beingmoved from the source shards to the destination shards, the clientperforming a get type of operation in the second manner relative to aprimary key at least in part by: determining, based at least in part ona quantity of shards in the multi-shard system preceding the change inthe quantity of shards, a source shard on which a data item having theprimary key is stored prior to the change in the quantity of shards;determining, based at least in part on a quantity of shards in themulti-shard system following the-change in the quantity of shards, adestination shard on which a data item having the primary key is to belocated after the change in the quantity of shards; determining that afirst data item on the destination shard has the primary key and a falsetombstone attribute value; and reading attribute values of the firstdata item.
 12. The computer-implemented method of claim 1, furthercomprising: while the one or more data items are being moved from thesource shards to the destination shards, the client performing a gettype of operation in the second manner relative to a primary key atleast in part by: determining, based at least in part on a quantity ofshards in the multi-shard system preceding the change in the quantity ofshards, a source shard on which a data item having the primary key isstored prior to the change in the quantity of shards; determining, basedat least in part on a quantity of shards in the multi-shard systemfollowing the change in the quantity of shards, a destination shard onwhich a data item having the primary key is to be located after thechange in the quantity of shards; determining that no data item on thedestination shard has the primary key; determining that a first dataitem on the source shard has the primary key and a false tombstoneattribute value; and reading attribute values of the first data item.13. The computer-implemented method of claim 1, further comprising:while the one or more data items are being moved from the source shardsto the destination shards, the client performing a get type of operationin the second manner relative to a primary key at least in part by:determining, based at least in part on a quantity of shards in themulti-shard system preceding the change in the quantity of shards, asource shard on which a data item having the primary key is stored priorto the change in the quantity of shards; determining, based at least inpart on a quantity of shards in the multi-shard system following thechange in the quantity of shards, a destination shard on which a dataitem having the primary key is to be located after the change in thequantity of shards; determining, at a first moment in time, that no dataitem on the destination shard has the primary key; determining that nodata item on the source shard has the primary key; determining, at asecond moment in time, that a first data item on the destination shardhas the primary key and a false tombstone attribute value; and readingattribute values of the first data item.
 14. The computer-implementedmethod of claim 1, wherein moving the one or more data items from thesource shards to the destination shards comprises: incrementing asystem-wide version number; and for each first data item having aversion number that is less than the system-wide version number,determining, based at least in part on a quantity of shards in themulti-shard system following the shard quantity change, a firstdestination shard on which the first data item is to be located afterthe change in the quantity of shards; for each second data item that (a)has a version number that is less than the system-wide version numberand (b) is located on a source shard that differs from a seconddestination shard on which the second data item is to be located afterthe change in the quantity of shards, inserting, into the seconddestination shard, a copy of the second item having the system-wideversion number; for each third data item that (a) has a version numberthat is less than the system-wide version number and (b) is alreadylocated on a third destination shard on which the third data item is tobe located after the change in the quantity of shards, changing aversion number of the third item to the system-wide version number. 15.The computer-implemented method of claim 1, wherein moving the one ormore data items from the source shards to the destination shardscomprises incrementing a system-wide version number, and furthercomprising: determining a set of queries that are pending against one ormore shards in the multi-shard system as of a time that the movement ofthe one or more data items completes; waiting for all queries in the setof queries to finish; after all queries in the set of queries havefinished, removing, from all shards in the multi-shard system, all dataitem copies having version number attribute values that differ from thesystem-wide version number; and after all queries in the set of querieshave finished, removing, from all shards in the multi-shard system, alldata item copies having true tombstone attribute values.
 16. Thecomputer-implemented method of claim 1, further comprising: while theone or more data items are being moved from the source shards to thedestination shards, and for each particular shard in the multi-shardsystem, populating a preliminary result queue for that particular shardwith data items that both (a) are located on that particular shard and(b) satisfy specified query criteria; for each particular shard'spreliminary result queue, sorting data items in that shard's preliminaryresult queue based at least in part on primary keys of the data item inthat shard's preliminary result queue; until a preliminary result queueof a shard that is non-empty does not exit, repeatedly performingoperations comprising: selecting a first data item from a set comprisingdata items currently located at tops of preliminary result queues of allof the shards in the multi-shard system, wherein selecting the firstdata item from the set comprising data items currently located at topsof preliminary result queues of all of the shards in the multi-shardsystem comprises: selecting, from the set, a subset of data items havinga smallest primary key of primary keys of data items in the set; andselecting, as the first data item, a data item having a largest versionnumber attribute value of version number attribute values of data itemin the subset, adding, to a final result set, each first data item thatdoes not have a true tombstone attribute value, and removing, from everyshard's preliminary result queue, all data item copies having a primarykey that matches a primary key of the first data item; and after everyshard's preliminary result queue is empty, returning data items in thefinal result set as query result.
 17. The computer-implemented method ofclaim 1, further comprising: while the one or more data items are beingmoved from the source shards to the destination shards, the clientattempting and failing to perform a delete type of operation in thesecond manner relative to a first data item having a primary key atleast in part by: determining that no data item on the source shard hasthe first data item's primary key; determining that no data item on thedestination shard has the first data item's primary key; and generatingdata that indicates that the delete operation failed due to the firstdata item not existing.
 18. A system comprising: a plurality of databaseshards that store data items; a plurality of clients that are configuredto transition, in response to a change in a quantity of the plurality ofdatabase shards, from a normal state to a rebalancing state, whereinduring the normal state, the client performs a type of operationrelative to the data items stored in the multi-shard system in a firstmanner, wherein during the rebalancing state, the client performs thetype of operation relative to the data items stored in the multi-shardsystem in a second manner, wherein the second manner is different thanthe first manner, wherein during the rebalancing state, the clientperforms the type of operation without the client acquiring one or moreexclusive locks relative to any of the data items, and wherein duringthe rebalancing state, the type of operation is performed based on: afirst shard in the multi-shard system, the first shard including a dataitem stored at a first memory location in the first shard before thechange in the quantity of the plurality of database shards, wherein thedata items is of data items; and a second shard in the multi-shardsystem, the second shard including the data item stored at a secondmemory location in the second shard after the change in the quantity ofthe plurality of database shards; and at least one computing deviceconfigured to (a) determine, while the plurality of clients are in therebalancing state, and for one or more data items of the data items, oneor more destination shards that are separate from one or more sourceshards, wherein the one or more source shards store the one or more dataitems during the normal state while each client of the plurality ofclients is in the normal state, and (b) move the one or more data itemsfrom the one or more source shards to the one or more destination shardswhile each client of the plurality of clients is in the rebalancingstate.
 19. A non-transitory computer-readable storage memory storingprocessor-executable instructions comprising: instructions to cause oneor more processors to determine a change in a quantity of shards in amulti-shard system that has a plurality of shards; instructions to causeone or more processors to transition a client, in response todetermining the change in the quantity of shards, from a normal state toa rebalancing state, wherein during the normal state, the clientperforms a type of operation relative to data items stored in themulti-shard system in a first manner, wherein during the rebalancingstate, the client performs the type of operation relative to the dataitems stored in the multi-shard system in a second manner, whereinduring the rebalancing state, the client performs the type of operationwithout the client acquiring one or more exclusive locks relative to anyof the data items, and wherein during the rebalancing state, the type ofoperation is performed based on: a first shard in the multi-shardsystem, the first shard including a data item stored at a first memorylocation in the first shard before the change in the quantity of shards,wherein the data is one of the data items; and a second shard in themulti-shard system, the second shard including the data item stored at asecond memory location in the second shard after the change in thequantity of shards; instructions to cause one or more processors todetermine, while the client is in the rebalancing state, and for one ormore data items of the data items, one or more destination shards thatare separate from one or more source shards, wherein the one or moresource shards store the one or more data items during the normal stateprior to transitioning the client from the normal state to therebalancing state; and instructions to cause one or more processorsto-move the one or more data items from the one or more source shards tothe one or more destination shards while the client is in therebalancing state.
 20. The computer-implemented method of claim 1,further comprising: identifying a first quantity of shards, wherein thefirst quantity of shards indicates a quantity of shards in themulti-shard system before the change in the quantity of shards;identifying a second quantity of shards, wherein the second quantity ofshards indicates a quantity of shards in the multi-shard system afterthe change in the quantity of shards; identifying the first shard basedon the first quantity of shards, wherein the first shard is included inthe plurality of shards; and identifying the second shard based on thesecond quantity of shards, wherein the second shard is included in theplurality of shards.